const obj = {}
function deepCopy(obj){
    const obj2 = Object.prototype.toString.call(obj) === "[object Array]" ? [] : {};
    for (let key in obj){
        if(obj.hasOwnProperty(key)){
            if(typeof obj[key] === "object"){
                obj2[key] = deepCopy(obj)
            }else {
                obj2[key] = obj[key]
            }
        }
    }
    return obj2
}
deepCopy(obj)